home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / MacHacksBug / Python 1.5.2c1 / Mac / Demo / calldll / samplecalldll.py < prev    next >
Encoding:
Text File  |  2000-06-23  |  747 b   |  25 lines

  1. #
  2. # Test calldll. Tell the user how often menus flash, and let her change it.
  3. #
  4.  
  5. import calldll
  6. import sys
  7.  
  8. # Obtain a reference to the library with the toolbox calls
  9. interfacelib = calldll.getlibrary('InterfaceLib')
  10.  
  11. # Get the routines we need (see LowMem.h for details)
  12. LMGetMenuFlash = calldll.newcall(interfacelib.LMGetMenuFlash, 'Short')
  13. LMSetMenuFlash = calldll.newcall(interfacelib.LMSetMenuFlash, 'None', 'InShort')
  14.  
  15. print "Menus currently flash",LMGetMenuFlash(),"times."
  16. print "How often would you like them to flash?",
  17.  
  18. # Note: we use input(), so you can try passing non-integer objects
  19. newflash = input()
  20. LMSetMenuFlash(newflash)
  21.  
  22. print "Okay, menus now flash", LMGetMenuFlash(),"times."
  23.  
  24. sys.exit(1)   # So the window stays on-screen
  25.